<?php
ini_set('output_buffering','On');
ini_set('error_reporting','');
session_start();

include("sysConnect.php");

$mod = getVar('mod');
$fl = getVar('act');
$free = getVar('free');;
$export = getVar('export');

if ( $fl != 'change_user_profile' )
	$_SESSION['cur_url'] = basename(__FILE__) . '?' . $_SERVER['QUERY_STRING'];

if ( empty($mod) )
	header('Location: index.php');
else if ( empty($free) )
{
	if ( empty($fl) )	$fl = "index";
	if ( !file_exists($info['module_path'] . $mod . '/' . $fl . '.php') )
	{
		include('header_admin.php');
		showMsg('ADMIN FILE: Không có dữ liệu !','ex','center');
		include('footer_admin.php');		
	}
	else
	{
		$fpath = $info['module_path'] . $mod . '/comFunctions.php';
		if ( file_exists($fpath) )
			include($fpath);
	
		if ( empty($export) )
		{
			$sql = "SELECT * FROM um_module WHERE modname='$mod'";
			$rs = $link->execute($sql);
			include('header_admin.php');
			BannerAdmin($rs->fields('moddesc'));
			newLine();
			include($info['module_path'] . $mod . '/' . $fl . '.php');	
			include('footer_admin.php');		
		}
		else
		{
			include($info['module_path'] . $mod . '/' . $fl . '.php');	
		}
	}
}
else
{
	include('header_admin.php');
	BannerAdmin($rs->fields('moddesc'));
	newLine();
	if ( empty($fl) )	$fl = 'index';
	if ( !file_exists($info['module_path_free'] . $fl . '.php') )
		showMsg('ADMIN FILE (FREE): Không có dữ liệu !','ex','center');
	else
		include($info['module_path_free'] . $fl . '.php');
	include('footer_admin.php');		
}
?>